package cn.iocoder.yudao.position.mapper;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.position.entity.PositionCategoryDO;
import cn.iocoder.yudao.position.vo.PositionCategoryPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 字典-行业类别表(树形结构) Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface PositionCategoryMapper extends BaseMapperX<PositionCategoryDO> {

    default PageResult<PositionCategoryDO> selectPage(PositionCategoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PositionCategoryDO>().eqIfPresent(PositionCategoryDO::getParentId, reqVO.getParentId()).eqIfPresent(PositionCategoryDO::getAncestors, reqVO.getAncestors()).likeIfPresent(PositionCategoryDO::getCategoryName, reqVO.getCategoryName()).eqIfPresent(PositionCategoryDO::getCategoryCode, reqVO.getCategoryCode()).eqIfPresent(PositionCategoryDO::getLevel, reqVO.getLevel()).eqIfPresent(PositionCategoryDO::getOrderNum, reqVO.getOrderNum()).eqIfPresent(PositionCategoryDO::getStatus, reqVO.getStatus()).betweenIfPresent(PositionCategoryDO::getCreateTime, reqVO.getCreateTime()).eqIfPresent(PositionCategoryDO::getRemark, reqVO.getRemark()).orderByDesc(PositionCategoryDO::getCategoryId));
    }

}